package frame.project;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;

import com.aviary.android.feather.FeatherActivity;

public class Edit2AviaryTestDrive extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    setContentView(R.layout.edit2aviarytestdrive);
	    startFeather();
	}
	
	public void startFeather() {
	    // Create the intent needed to start feather
	    Intent newIntent = new Intent( this, FeatherActivity.class );
	    
	    // set the source image uri
	    //newIntent.setData( uri );
	    
	 	// pass the required api key ( http://developers.aviary.com/ )
	    newIntent.putExtra( "API_KEY", "Xe3iRJJi9kqiD3yM0DFIbQ" );
	    // pass the uri of the destination image file (optional)
	    // This will be the same uri you will receive in the onActivityResult
	    //newIntent.putExtra( "output", Uri.parse( "file://" + mOutputFile.getAbsolutePath() ) );
	    // format of the destination image (optional)
	    newIntent.putExtra( "output-format", Bitmap.CompressFormat.JPEG.name() );
	    // output format quality (optional)
	    newIntent.putExtra( "output-quality", 100 );
	    // you can force feather to display only a certain tools
	    newIntent.putExtra( "tools-list", new String[]{"ADJUST", "BRIGHTNESS", "ROTATE", "BLUR", "CROP", "EFFECTS" } );

	    // enable fast rendering preview
	    newIntent.putExtra( "effect-enable-fast-preview", true );

	    // limit the image size
	    // You can pass the current display size as max image size because after
	    // the execution of Aviary you can save the HI-RES image so you don't need a big
	    // image for the preview
	    // newIntent.putExtra( "max-image-size", 800 );   

	    // you want to hide the exit alert dialog shown when back is pressed
	    // without saving image first
	    newIntent.putExtra( "hide-exit-unsave-confirmation", false );

	    // ..and start feather
	    //startActivityForResult( newIntent, ACTION_REQUEST_FEATHER );
	}
}
